<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  <title>vue-api-webpack</title>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
<header></header>
<div id='root' v-cloak>
</div>
<footer></footer>
<script src="../../assets/js/fastclick.js" type='application/javascript'></script>
<!--<script src="../../assets/js/vconsole.min.js" type='application/javascript'></script>-->
<script type="text/javascript" src="../../script/api.js"></script>
<script>
  // var modEl = document.getElementById('progressModal');
  if ("addEventListener" in document) {
    document.addEventListener("DOMContentLoaded", function () {
      FastClick.attach(document.body);
    }, false);
  }

  // function onload() {
  //   modEl.style.display = 'none';
  //   var backDom = document.querySelector('.van-nav-bar__left .van-nav-bar__arrow');
  //   if (backDom) {
  //     backDom.addEventListener('click', function () {
  //       closeWin();
  //     })
  //   }
  // }

  // function closeWin() {
  //   if (window.api) {
  //     api.closeWin();
  //   } else{
  //     history.go(-1);
  //   }
  // }

  apiready = function () {

    // var header = $api.dom('header'); // 获取 header 标签元素
    // var footer = $api.dom('footer'); // 获取 footer 标签元素
    // var headerH = $api.fixStatusBar(header);
    // var footerH = $api.fixTabBar(footer);

    var location = this.global ? global.location : window.location;
    var htmlname = location.href.split("/").pop().split(".")[0];
    var n = htmlname + "_frame";
    var fspath = "./" + n + ".html";

    api.openFrame({
      name: n,
      url: fspath,
      rect: {
        x: 0,             //左上角x坐标
        y: "46px",             //左上角y坐标
        w: "auto",           //宽度，若传'auto'，页面从x位置开始自动充满父页面宽度
        h: "auto",           //高度，若传'auto'，页面从y位置开始自动充满父页面高度

        marginLeft: 0,    //相对父 window 左外边距的距离
        marginTop: 0,     //相对父 window 上外边距的距离
        marginBottom: 0,  //相对父 window 下外边距的距离
        marginRight: 0,    //相对父 window 右外边距的距离
      },
      bgColor: "#1e838b",
      useWKWebView: true,
    });

  };

</script>
</body>
</html>
